package com.fh.controller;

import com.fh.service.ProductService;
import com.fh.vo.ResultVo;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/product")
@CrossOrigin
@Api(value = "",tags = "商品管理")
public class ProductController {

    @Resource
    private ProductService productService;
    @GetMapping("list")
    public ResultVo selectProductVO(){
        return  productService.selectProductVO();
    }

    @GetMapping("select/{productId}")
    public  ResultVo getProductDetailsInfo( @PathVariable("productId") String productId){
      return   productService.getProductDetailsInfo(productId);
    }
    @GetMapping("search-product")
    public  ResultVo searchProduct( String keyWord , int pageNum,int limit){
      return   productService.searchProduct(keyWord,pageNum,limit);
    }

}
